-
Notifications
You must be signed in to change notification settings - Fork 28
Test on all operating systems and make Miri run on CI #90
base: master
Are you sure you want to change the base?
Conversation
It might be a good idea to test on all operating systems, since they have differences in memory management and file operations which might cause bugs.
Codecov Report
@@ Coverage Diff @@
## master #90 +/- ##
==========================================
+ Coverage 91.37% 92.85% +1.48%
==========================================
Files 5 5
Lines 313 308 -5
==========================================
Hits 286 286
+ Misses 27 22 -5
Continue to review full report at Codecov.
|
I like those changes! Any ideas why windows fails? Regarding the miri fail, this is due to a YAML dependency and is also tracked here #87 |
It seems to be an issue with tempfiles, since it's not possible to persist the database file due to #[test]
#[cfg_attr(miri, ignore)]
fn test_path_backend_existing() {
let path = PathBuf::from("./test_path_backend_existing.db");
{
let file = std::fs::OpenOptions::new()
.read(true)
.write(true)
.truncate(true)
.create(true)
.open(&path).expect("could not create temporary file");
}
let (mut backend, existed) = PathBackend::from_path_or_create(path.clone()).expect("could not create backend");
assert!(existed);
let data = [4, 5, 1, 6, 8, 1];
backend.put_data(&data).expect("could not put data");
assert_eq!(backend.get_data().expect("could not get data"), data);
std::fs::remove_file(path).expect("file should be deleted");
} |
Nice. I hadn't noticed that Strange windows issue. I'm afraid it will also cause issues with the integration tests. fn test_file_persist() {
let file = NamedTempFile::new().expect("could not create temporary file");
println!("`file` path: {:?}", file.path());
let file_path = file.path().to_owned();
let file2 = NamedTempFile::new().expect("could not create temporary file");
println!("`file2` path: {:?}", file2.path());
file2.persist(file_path).expect("could not persist file2 to file");
} Maybe the problem is that @TheNeikos How about merging this and creating a tracking issue for the windows test failures? |
I tested it on windows, and this is exactly the problem. I can make a PR to fix the tests. Maybe this PR can be merged first to keep the git history somewhat clean? |
I went ahead and opened #92 to fix the tests on windows (and document the YAML UB). |
@TheNeikos Any chance for these two PRs to be merged? |
It might be a good idea to test on all operating systems, since they have differences in memory management and file operations which might cause bugs. It should run the tests in parallel, so there shouldn't be any significant overhead for this change.
This also fixes the set_env command to make Miri actually run (though I haven't fixed any bugs, so it still fails, but now it does so because it actually runs).